package com.pureman.androidapp.titanic;

import android.os.Bundle;
import android.os.Handler;
import android.support.v7.app.AppCompatActivity;

import com.pureman.androidapp.R;

public class TitanicActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_titanic);

        TitanicTextView tv = (TitanicTextView) findViewById(R.id.my_text_view);

        // set fancy typeface
        tv.setTypeface(Typefaces.get(this, "Satisfy-Regular.ttf"));

        // start animation
        final Titanic titanic = new Titanic();
        titanic.start(tv);

        new Handler().postDelayed(new Runnable() {
            @Override
            public void run() {
                titanic.cancel();
            }
        }, 10000);
    }
}
